package com.yanyu.space.common.log.message;

import lombok.Data;

/**
 * @author yanyu
 */
@Data
public class LogMessage {

    protected byte[] message;

    protected Integer size;

    public LogMessage() {
        this.size = 0;
    }

    public LogMessage(byte[] message) {
        this.message = message;
        this.size = this.message.length;
    }

    @Override
    public String toString() {
        return message != null && message.length > 0 ? new String(message) : "";
    }
}
